<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta name="viewport"
          content="initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,width=device-width">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="telephone=no" name="format-detection">
    <title>
        <block name="pageTitle">
            加鑫财经
        </block>
    </title>
    <block name="pageStatic">
        <link href="__CSS__/style.css" rel="stylesheet"/>
        <script src="__JS__/jquery-1.10.1.min.js"></script>
        <script src="__JSPLUGINS__/layer/layer.js"></script>
    </block>
    <!-- 添加静态资源 -->
    <block name="pageAddStatic"></block>
</head>

<body>
<!-- 头部 -->
<block name="pageHeader">
    <include file="Public/header" />
</block>
<!-- 内容 -->
<block name="pageContent">
</block>
<!-- 脚部 -->
<block name="pageFooter">
    <include file="Public/footer" />
</block>
</body>
</html>
<!-- js代码 -->
<block name="initJavascript">
    <script>

        // 订阅
        $(".tb1").click(function () {

        })

        // 收藏
        $(".tb2").click(function () {
            var _this = $(this);
            $article_id = $(this).attr('article-id');
            var data = {};
            data['article_id'] = $article_id;
            $.ajax({
                type: "POST",
                url: "{:U('Article/ajaxAddCollect')}",
                data: data,
                dataType: "json",
                success:function(result){
                    console.log(result);
                    if(result && result.error==0){
                        var collect_number = Number(_this.html());
                        console.log(collect_number);
                        _this.html(++collect_number);
                        layer.msg(result.msg);
                    }else if(result.msg){
                        layer.msg(result.msg);
                    }else{
                        layer.msg('网络异常, 请稍后尝试!');
                    }
                }

            });
        })
    </script>
</block>
<!-- js代码 -->
<block name="pageJavascript">
</block>
